var emid;
window.onload=function (){
    emid=getQuery("id");
    console.log(emid)
    findById();
}
function findById(){
    axios.get("/em/findById",{
        params:{
            id:emid
        }
    }).then(resp=>{
        let info=resp.data;
        $("nameSpan").innerHTML=info.name
        $("phoneSpan").innerHTML=info.phone
        $("moneyTxt").value=info.money
        $("faceImg").src="/emFace/"+info.imgPath;
    })
}

function update() {
    axios.get("/em/update",{
        params: {
            id:emid,
            money:$("moneyTxt").value
        }
    }).then(resp=>{
       var info= resp.data
        if (info=="ok"){
            location.href="main.html"
        }
    })
}